#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
pdd a[15];
double dp[1 << 15][15];
double dist(pdd a, pdd b) {
  double dx = a.first - b.first;
  double dy = a.second - b.second;
  return sqrt(dx * dx + dy * dy);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 0, n - 1) cin >> a[i].first >> a[i].second;
  int mask = (1 << n) - 1;
  rep(i, 1, mask) {
    rep(j, 0, n - 1) {
      dp[i][j] = 1e18;
      if (i & (1 << j)) {
        int s = i ^ (1 << j);
        if (!s) {
          dp[i][j] = dist(a[j], pdd(0, 0));
          break;
        }
        rep(k, 0, n - 1) {
          if (s & (1 << k))
            dp[i][j] = min(dp[i][j], dp[s][k] + dist(a[k], a[j]));
        }
      }
    }
  }
  double ans = 1e18;
  rep(i, 0, n - 1) ans = min(ans, dp[mask][i]);
  cout << fixed << setprecision(2) << ans;
  return 0;
}